USE [OHNEW]
GO

/****** Object:  Table [dbo].[D_PurchaseOrder]    Script Date: 01/24/2013 12:09:41 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[D_PurchaseOrder](
	[ID] [uniqueidentifier] NOT NULL,
	[OrderType] [int] NOT NULL,
	[Code] [varchar](50) NOT NULL,
	[Vendor] [uniqueidentifier] NOT NULL,
	[Company] [uniqueidentifier] NOT NULL,
	[Buyer] [uniqueidentifier] NULL,
	[DocumentDate] [datetime] NOT NULL,
	[Currency] [uniqueidentifier] NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[DelvDate] [datetime] NOT NULL,
	[PaymentDate] [datetime]  NULL,
	[DeliveryType] [varchar](50) NULL,
	[FreightType] [int] NOT NULL default 0,
	[VSONumber] [varchar](50) NULL,
	[CreatedBy] [uniqueidentifier] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[CheckStatus] [int] NULL,
	[CheckedBy] [uniqueidentifier] NULL,
	[CheckDate] [datetime] NULL,
	[Finished] [int] NOT NULL,
	[InvoiceStatus] [int] NOT NULL,
	[PaymentType] [uniqueidentifier] NULL,
	[Notes] [varchar](250) NULL,
 CONSTRAINT [PK_D_PurchaseOrder] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[D_PurchaseOrder] ADD  DEFAULT (newid()) FOR [ID]
GO


